package com.road.entity;

import com.google.common.base.Splitter;

public class QuestCondiction {

	private int templateId;
	private int condictionId;
	private int condictionType;
	private String condictionTitle;
	private String para1;
	private int para2;
	private int para3;
	private String para4;

	public int getTemplateId() {
		return this.templateId;
	}

	public void setTemplateId(int templateId) {
		this.templateId = templateId;
	}

	public int getCondictionId() {
		return this.condictionId;
	}

	public void setCondictionId(int condictionId) {
		this.condictionId = condictionId;
	}

	public int getCondictionType() {
		return this.condictionType;
	}

	public void setCondictionType(int condictionType) {
		this.condictionType = condictionType;
	}

	public String getCondictionTitle() {
		return this.condictionTitle;
	}

	public void setCondictionTitle(String condictionTitle) {
		this.condictionTitle = condictionTitle;
	}

	public int getPara1() {
		if (this.para1 == null || this.para1.trim().length() == 0) {
			return 0;
		}
		if (this.para1.indexOf(",") < 0) {
			return Integer.parseInt(this.para1);
		}
		return 0;
	}

	public int[] getPara1List() {
		int length = this.para1.split(",").length;
		int[] result = new int[length];
		Iterable<String> iterable = Splitter.on(",").split(this.para1);
		int i = 0;
		for (String string : iterable) {
			result[i++] = Integer.parseInt(string);
		}
		return result;
	}

	public String getPara1Str() {
		return this.para1;
	}

	public void setPara1(String para1) {
		this.para1 = para1;
	}

	public int getPara2() {
		return this.para2;
	}

	public void setPara2(int para2) {
		this.para2 = para2;
	}

	public int getPara3() {
		return para3;
	}

	public void setPara3(int para3) {
		this.para3 = para3;
	}

	public String getPara4() {
		return para4;
	}

	public void setPara4(String para4) {
		this.para4 = para4;
	}

	@Override
	public String toString() {
		return "QuestCondiction [templateId=" + templateId + ", condictionId=" + condictionId + ", condictionType=" + condictionType
				+ ", condictionTitle=" + condictionTitle + ", para1=" + para1 + ", para2=" + para2 + ", para3=" + para3 + ", para4=" + para4 + "]";
	}

}
